
package Launcher;

import Acciones.Comunes.AccionClientes;
import Acciones.Comunes.AccionIngreso;
import Acciones.Comunes.AccionPerfiles;
import Acciones.Comunes.AccionUsuarios;
import Componentes.GlassPanel;
import Configuraciones.Configuraciones;
import Modelos.TblPantallasPerfiles;
import Modelos.TblPerfilesUsuarios;
import Modelos.TblUsuarios;
import java.util.Collection;
import javax.swing.JFrame;


public class GoBox extends javax.swing.JFrame {
    private TblUsuarios usuarioGlobal;
    private static GoBox yo=null;
    

    public GoBox(Collection<TblPerfilesUsuarios> perfiles) {
        com.apple.eawt.FullScreenUtilities.setWindowCanFullScreen(this, true);
        initComponents();
        this.setExtendedState(JFrame.MAXIMIZED_BOTH);
        this.setLocationRelativeTo(null);
        this.setGlassPane(new GlassPanel());
        this.getGlassPane().setVisible(true);
        dlgSelectorPerfil selector = new dlgSelectorPerfil(this, false,perfiles,this);
        selector.setVisible(true);
        accionPerfilusuario1.setUsuarioGlobal(this);
        yo=this;
        
    }
    
    public static  GoBox getInstance(){
        return yo;
    }
    
    
    public void ActivarFX(Collection<TblPantallasPerfiles> perfiles){
        for (TblPantallasPerfiles pantallas : perfiles) {
           String nom= pantallas.getTblpantallasIdpantalla().getPantalla();
            if(AccionPerfiles.FRAME.equals(nom))
                accionPerfiles1.setEnabled(pantallas.getTblpantallasIdpantalla().getEstatus() && pantallas.getEstatus());
            if(AccionUsuarios.FRAME.equals(nom))
                accionUsuarios1.setEnabled(pantallas.getTblpantallasIdpantalla().getEstatus() && pantallas.getEstatus());
            if(AccionIngreso.FRAME.equals(nom))
                accionIngreso1.setEnabled(pantallas.getTblpantallasIdpantalla().getEstatus() && pantallas.getEstatus());
            if(AccionClientes.FRAME.equals(nom))
                accionClientes1.setEnabled(pantallas.getTblpantallasIdpantalla().getEstatus() && pantallas.getEstatus());
        }
        this.getGlassPane().setVisible(false);
    }
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {
        bindingGroup = new org.jdesktop.beansbinding.BindingGroup();

        accionUsuarios1 = new Acciones.Comunes.AccionUsuarios();
        accionPerfiles1 = new Acciones.Comunes.AccionPerfiles();
        accionPerfilusuario1 = new Acciones.Comunes.AccionPerfilusuario();
        accionIngreso1 = new Acciones.Comunes.AccionIngreso();
        accionClientes1 = new Acciones.Comunes.AccionClientes();
        jPanel1 = new javax.swing.JPanel();
        jTabbedPane1 = new javax.swing.JTabbedPane();
        pnlEntrada = new org.edisoncor.gui.panel.PanelNice();
        pnlEntrada2 = new org.edisoncor.gui.panel.PanelNice();
        panelImage2 = new org.edisoncor.gui.panel.PanelImage();
        jLabel1 = new javax.swing.JLabel();
        jLabel2 = new javax.swing.JLabel();
        pnlRedondo1 = new org.edisoncor.gui.panel.PanelNice();
        pnlRedondo = new org.edisoncor.gui.panel.PanelNice();
        jScrollPane1 = new javax.swing.JScrollPane();
        jDesktopPane1 = new javax.swing.JDesktopPane();
        jMenuBar1 = new javax.swing.JMenuBar();
        jMenu1 = new javax.swing.JMenu();
        jMenuItem5 = new javax.swing.JMenuItem();
        jMenu2 = new javax.swing.JMenu();
        jMenuItem4 = new javax.swing.JMenuItem();
        jMenu3 = new javax.swing.JMenu();
        jMenu4 = new javax.swing.JMenu();
        jMenuItem1 = new javax.swing.JMenuItem();
        jMenuItem2 = new javax.swing.JMenuItem();
        jMenuItem3 = new javax.swing.JMenuItem();
        jMenu5 = new javax.swing.JMenu();

        accionUsuarios1.setEnabled(false);
        accionUsuarios1.setEscritorio(jDesktopPane1);

        accionPerfiles1.setEnabled(false);
        accionPerfiles1.setEscritorio(jDesktopPane1);

        accionPerfilusuario1.setEscritorio(jDesktopPane1);

        accionIngreso1.setEnabled(false);
        accionIngreso1.setEscritorio(jDesktopPane1);

        accionClientes1.setEnabled(false);
        accionClientes1.setEscritorio(jDesktopPane1);

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
        setTitle(Configuraciones.NOMBRE_APP);
        setIconImage(Configuraciones.ICONO_APP);

        org.jdesktop.beansbinding.Binding binding = org.jdesktop.beansbinding.Bindings.createAutoBinding(org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE, jPanel1, org.jdesktop.beansbinding.ELProperty.create("${background}"), this, org.jdesktop.beansbinding.BeanProperty.create("background"));
        bindingGroup.addBinding(binding);

        jPanel1.setBackground(new java.awt.Color(220, 230, 240));

        jTabbedPane1.setBackground(new java.awt.Color(255, 255, 255));
        jTabbedPane1.setTabLayoutPolicy(javax.swing.JTabbedPane.SCROLL_TAB_LAYOUT);
        jTabbedPane1.setTabPlacement(javax.swing.JTabbedPane.LEFT);

        pnlEntrada.setBackground(new java.awt.Color(255, 255, 255));
        pnlEntrada.setAnchoDeBorde(3.0F);

        pnlEntrada2.setBackground(new java.awt.Color(121, 137, 167));
        pnlEntrada2.setAnchoDeBorde(0.0F);
        pnlEntrada2.setBorderColor(new java.awt.Color(220, 230, 240));

        panelImage2.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Recursos/Imagenes/gobox_mini.png"))); // NOI18N
        panelImage2.setMinimumSize(new java.awt.Dimension(64, 64));

        org.jdesktop.layout.GroupLayout panelImage2Layout = new org.jdesktop.layout.GroupLayout(panelImage2);
        panelImage2.setLayout(panelImage2Layout);
        panelImage2Layout.setHorizontalGroup(
            panelImage2Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(0, 64, Short.MAX_VALUE)
        );
        panelImage2Layout.setVerticalGroup(
            panelImage2Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(0, 64, Short.MAX_VALUE)
        );

        jLabel1.setFont(new java.awt.Font("Arial Rounded MT Bold", 2, 46)); // NOI18N
        jLabel1.setForeground(new java.awt.Color(255, 255, 255));
        jLabel1.setText("GoBox ");

        jLabel2.setFont(new java.awt.Font("Lucida Grande", 0, 14)); // NOI18N
        jLabel2.setForeground(new java.awt.Color(255, 255, 255));
        jLabel2.setText("Sistema de Paquetería y Mesajeria.");

        org.jdesktop.layout.GroupLayout pnlEntrada2Layout = new org.jdesktop.layout.GroupLayout(pnlEntrada2);
        pnlEntrada2.setLayout(pnlEntrada2Layout);
        pnlEntrada2Layout.setHorizontalGroup(
            pnlEntrada2Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(pnlEntrada2Layout.createSequentialGroup()
                .add(16, 16, 16)
                .add(panelImage2, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                .add(18, 18, 18)
                .add(pnlEntrada2Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                    .add(jLabel2, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .add(pnlEntrada2Layout.createSequentialGroup()
                        .add(jLabel1, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 238, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                        .add(0, 347, Short.MAX_VALUE)))
                .addContainerGap())
        );
        pnlEntrada2Layout.setVerticalGroup(
            pnlEntrada2Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(org.jdesktop.layout.GroupLayout.TRAILING, pnlEntrada2Layout.createSequentialGroup()
                .addContainerGap(7, Short.MAX_VALUE)
                .add(pnlEntrada2Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING, false)
                    .add(panelImage2, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                    .add(pnlEntrada2Layout.createSequentialGroup()
                        .add(jLabel1, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 44, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                        .add(jLabel2)))
                .addContainerGap())
        );

        pnlRedondo1.setBackground(new java.awt.Color(220, 230, 240));

        org.jdesktop.layout.GroupLayout pnlRedondo1Layout = new org.jdesktop.layout.GroupLayout(pnlRedondo1);
        pnlRedondo1.setLayout(pnlRedondo1Layout);
        pnlRedondo1Layout.setHorizontalGroup(
            pnlRedondo1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(0, 0, Short.MAX_VALUE)
        );
        pnlRedondo1Layout.setVerticalGroup(
            pnlRedondo1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(0, 358, Short.MAX_VALUE)
        );

        org.jdesktop.layout.GroupLayout pnlEntradaLayout = new org.jdesktop.layout.GroupLayout(pnlEntrada);
        pnlEntrada.setLayout(pnlEntradaLayout);
        pnlEntradaLayout.setHorizontalGroup(
            pnlEntradaLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(pnlEntradaLayout.createSequentialGroup()
                .add(16, 16, 16)
                .add(pnlEntradaLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                    .add(pnlEntrada2, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .add(pnlRedondo1, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                .add(16, 16, 16))
        );
        pnlEntradaLayout.setVerticalGroup(
            pnlEntradaLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(pnlEntradaLayout.createSequentialGroup()
                .add(8, 8, 8)
                .add(pnlEntrada2, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                .add(16, 16, 16)
                .add(pnlRedondo1, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .add(16, 16, 16))
        );

        jTabbedPane1.addTab("Inicio", pnlEntrada);

        pnlRedondo.setBackground(new java.awt.Color(255, 255, 255));
        pnlRedondo.setAnchoDeBorde(3.0F);

        jScrollPane1.setBorder(null);

        jDesktopPane1.setOpaque(false);
        jScrollPane1.setViewportView(jDesktopPane1);

        org.jdesktop.layout.GroupLayout pnlRedondoLayout = new org.jdesktop.layout.GroupLayout(pnlRedondo);
        pnlRedondo.setLayout(pnlRedondoLayout);
        pnlRedondoLayout.setHorizontalGroup(
            pnlRedondoLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(pnlRedondoLayout.createSequentialGroup()
                .add(4, 4, 4)
                .add(jScrollPane1)
                .add(4, 4, 4))
        );
        pnlRedondoLayout.setVerticalGroup(
            pnlRedondoLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(pnlRedondoLayout.createSequentialGroup()
                .add(4, 4, 4)
                .add(jScrollPane1)
                .add(4, 4, 4))
        );

        jTabbedPane1.addTab("Escritorio", pnlRedondo);

        org.jdesktop.layout.GroupLayout jPanel1Layout = new org.jdesktop.layout.GroupLayout(jPanel1);
        jPanel1.setLayout(jPanel1Layout);
        jPanel1Layout.setHorizontalGroup(
            jPanel1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(jTabbedPane1, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 767, Short.MAX_VALUE)
        );
        jPanel1Layout.setVerticalGroup(
            jPanel1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(jTabbedPane1)
        );

        jMenu1.setText("Catálogos");

        jMenuItem5.setAction(accionClientes1);
        jMenu1.add(jMenuItem5);

        jMenuBar1.add(jMenu1);

        jMenu2.setText("Movimientos");

        jMenuItem4.setAction(accionIngreso1);
        jMenu2.add(jMenuItem4);

        jMenuBar1.add(jMenu2);

        jMenu3.setText("Configuración");

        jMenu4.setText("Permisos");

        jMenuItem1.setAction(accionUsuarios1);
        jMenu4.add(jMenuItem1);

        jMenuItem2.setAction(accionPerfiles1);
        jMenu4.add(jMenuItem2);

        jMenu3.add(jMenu4);

        jMenuItem3.setAction(accionPerfilusuario1);
        jMenu3.add(jMenuItem3);

        jMenuBar1.add(jMenu3);

        jMenu5.setText("Ayuda");
        jMenuBar1.add(jMenu5);

        setJMenuBar(jMenuBar1);

        org.jdesktop.layout.GroupLayout layout = new org.jdesktop.layout.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(jPanel1, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(layout.createSequentialGroup()
                .add(jPanel1, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .add(0, 0, 0))
        );

        bindingGroup.bind();

        pack();
    }// </editor-fold>//GEN-END:initComponents

   
    public static void main(String args[]) {
       
        java.awt.EventQueue.invokeLater(new Runnable() {

            @Override
            public void run() {
                
                new GoBox(null).setVisible(true);
            }
        });
    }
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private Acciones.Comunes.AccionClientes accionClientes1;
    private Acciones.Comunes.AccionIngreso accionIngreso1;
    private Acciones.Comunes.AccionPerfiles accionPerfiles1;
    private Acciones.Comunes.AccionPerfilusuario accionPerfilusuario1;
    private Acciones.Comunes.AccionUsuarios accionUsuarios1;
    private javax.swing.JDesktopPane jDesktopPane1;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JMenu jMenu1;
    private javax.swing.JMenu jMenu2;
    private javax.swing.JMenu jMenu3;
    private javax.swing.JMenu jMenu4;
    private javax.swing.JMenu jMenu5;
    private javax.swing.JMenuBar jMenuBar1;
    private javax.swing.JMenuItem jMenuItem1;
    private javax.swing.JMenuItem jMenuItem2;
    private javax.swing.JMenuItem jMenuItem3;
    private javax.swing.JMenuItem jMenuItem4;
    private javax.swing.JMenuItem jMenuItem5;
    private javax.swing.JPanel jPanel1;
    private javax.swing.JScrollPane jScrollPane1;
    private javax.swing.JTabbedPane jTabbedPane1;
    private org.edisoncor.gui.panel.PanelImage panelImage2;
    private org.edisoncor.gui.panel.PanelNice pnlEntrada;
    private org.edisoncor.gui.panel.PanelNice pnlEntrada2;
    private org.edisoncor.gui.panel.PanelNice pnlRedondo;
    private org.edisoncor.gui.panel.PanelNice pnlRedondo1;
    private org.jdesktop.beansbinding.BindingGroup bindingGroup;
    // End of variables declaration//GEN-END:variables

    public TblUsuarios getUsuarioGlobal() {
        return usuarioGlobal;
    }

    public void setUsuarioGlobal(TblUsuarios usuarioGlobal) {
        this.usuarioGlobal = usuarioGlobal;
    }
  }
